#pragma once
#ifndef SDEF_NODE
#define SDEF_NODE

#include <vector>

namespace SheepDefence
{
	class Graph;
	class Instance;
	class DogInstance;
	class WolfInstance;
	class ObstacleInstance;

	class Node
	{

	public:
		
		float x, y, point, shared, sharedHungry;
		std::vector<std::pair<Node*, float> > neighbours;

		Graph* owner;

		Node();

		~Node();

		void init(float x, float y, Graph* g);

		void addNeighbour(Node*);

		void update();

		void reset();

		void addOrigin(float x, float y, std::vector<ObstacleInstance*>& obstacles, float size);
		void addOrigin(float x, float y, std::vector<ObstacleInstance*>& obstacles, float size, std::vector<ObstacleInstance*>& exceptions);
		void addOrigin(float x, float y, std::vector<ObstacleInstance*>& obstacles, WolfInstance* wolf, DogInstance* dog);

		bool calculate();
		bool calculate(WolfInstance* wolf, DogInstance* dog);

		void addSharedOrigin(float x, float y, std::vector<ObstacleInstance*>& obstacles, WolfInstance* wolf, DogInstance* dog);
		void sharedReset();
		bool calculateShared(WolfInstance* wolf, DogInstance* dog);
	};
}
#endif